#include "DuelECCommon.h"
#include "Duel.h"
#include "DuelRenderWorkshop.h"
#include "DuelECRenderWorkshop.h"
#include "DuelEditorCommonComponent.h"

using namespace Duel;

namespace DuelEC
{

	DuelECComponent::DECComponent* DuelECComponent::msComponent = NULL;

	DuelECComponent::DuelECComponent()
	{

	}

	DuelECComponent::~DuelECComponent()
	{

	}

	void DuelECComponent::init()
	{
		msComponent = new DECComponent;
		msComponent->renderWorkshop = new DECRenderWorkshop();
		DCore::getSingleton().setRenderWorkshop(msComponent->renderWorkshop);
		
	}

	void DuelECComponent::shutdown()
	{
		DCore::getSingleton().setRenderWorkshop(NULL);
		delete msComponent->renderWorkshop;
		delete msComponent;
		msComponent = NULL;
	}

	Duel::DRenderWorkshop* DuelECComponent::getRenderWorkshop()
	{
		if (msComponent == NULL)
		{
			return NULL;
		}
		return msComponent->renderWorkshop;
	}

}
